<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="theme-color" content="#000000">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Gitee Star Charts</title>
    <link rel="apple-touch-icon-precomposed"href="/favicon.png" sizes="144x144"  />
    <link rel="apple-touch-icon-precomposed" href="/favicon.png" sizes="152x152" />
    <link rel="icon" type="image/png" href="/favicon.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="/favicon.png" sizes="16x16" />
    <meta name="description" content="StarCharts">
    <meta name="author" content="https://github/zhangyd-c">
    <link rel="stylesheet" href="/stylesheets/style.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.7.1/build/styles/dracula.min.css">
</head>
<body>
<div class="title">
    <img class="banner" src="/images/stars.svg" alt="Stars">
    <span class="title"><a href="/">gitee-stargazers</a></span>
    <span class="subtitle">将 Gitee 项目的 Star 增长趋势显示到统计图上。</span>
    <span class="subtitle"><a href='https://gitee.com/yadong.zhang/gitee-stargazers'><img src='https://gitee.com/yadong.zhang/gitee-stargazers/badge/star.svg?theme=dark' alt='star'></img></a></span>
</div>

<% if(typeof starTotal != 'undefined' && starTotal != -1) {%>
<div class="main">
    <p>
        <b>Niubility!</b>
        <a href="https://gitee.com/<%=owner%>/<%=repo%>" target="_blank"><%=owner%>/<%=repo%></a>
        已经获得 <b><%=starTotal%></b> 个 star！<!-- since <time><%=startTime%></time>-->.
    </p>
    <p class="subtext">
        图表的加载时间取决了你的仓库关注量的大小。 so，如果加载过慢，说明你的项目非常火！
    </p>
    <p class="subtext">
        如果图表长时间未加载完成，请手动刷新页面：<a href="/<%=owner%>/<%=repo%><% if(typeof expireTime != 'undefined' && expireTime != null) {%>?e=<%=expireTime%><%}%>"><%=owner%>/<%=repo%><% if(typeof expireTime != 'undefined' && expireTime != null) {%>?e=<%=expireTime%><%}%></a>
    </p>
</div>
<div class="chart">

    <p style="text-align: center" id="loading0">
        图表正在生成中，请稍后...
    </p>
    <p>
        <img src="/stars/<%=owner%>/<%=repo%><% if(typeof expireTime != 'undefined' && expireTime != null) {%>?e=<%=expireTime%><%}%>" class="chartImg" data-target-load="loading0">
    </p>
</div>

<div class="code">
    <p>
        现在你可以将上方的图表添加到你项目的
        <code>README.md</code>
        中:
    </p>
    <pre>
        <code class="markdown">
## Stargazers over time
[![Stargazers over time](https://whnb.wang/stars/<%=owner%>/<%=repo%><% if(typeof expireTime != 'undefined' && expireTime != null) {%>?e=<%=expireTime%><%}%>)](https://whnb.wang)
      </code>
    </pre>
</div>

<div class="title split-line">
    <span class="title"><a href="/">gitee-contributors</a></span>
    <span class="subtitle">将 Gitee 项目的贡献者头像整合为一张完整图片。</span>
</div>
<div class="chart">
    <p style="text-align: center" id="loading1">
        图片正在生成中，请稍后...
    </p>
    <p>
        <img src="/contributors/<%=owner%>/<%=repo%>" class="chartImg" data-target-load="loading1">
    </p>
</div>

<div class="code">
    <p>
        现在你可以将上方的图表添加到你项目的
        <code>README.md</code>
        中:
    </p>
    <pre>
        <code class="markdown">
## contributors
[![contributors](https://whnb.wang/contributors/<%=owner%>/<%=repo%>)](https://whnb.wang)
      </code>
    </pre>
    <p>
        贡献者列表图默认一行 10 张 avatar，如果你想定制化，
    </p>
    <p>
        可以修改链接为 <code class="subtext">/contributors/{owner}/{repo}/{num}</code>，如一行显示 15 张 avatar：
    </p>

    <pre>
        <code class="markdown">
## contributors
[![contributors](https://whnb.wang/contributors/<%=owner%>/<%=repo%>/15)](https://whnb.wang)
      </code>
    </pre>
</div>
<% } else {%>
<div class="main">
    你可通过修改浏览器地址为 <b>https://www.whnb.wang/{owner}/{repo}</b> 查看指定代码库的统计图，例如：<a href="/yadong.zhang/JustAuth">yadong.zhang/JustAuth</a>
    <p class="subtext">
        统计图默认会缓存1个小时
    </p>
    <p class="subtext">
        你可以通过<b>https://www.whnb.wang/{owner}/{repo}?e=10000</b>的方式使用自定义缓存，此种方式的缓存配置优先级最高
    </p>
</div>
<%}%>
<% if(typeof error != 'undefined' && error != null) {%>
<div class="main">
    <span class="error"><%=error%></span>
</div>
<%}%>

<script src="https://cdn.jsdelivr.net/npm/jquery@1.12.4/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.7.1/build/highlight.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@10.7.1/build/languages/markdown.min.js"></script>

<script>hljs.highlightAll();</script>
<script>
    $('.chartImg').each(function() {
        loadImage($(this).attr("src"), $(this).data('target-load'), function (img, targetLoadId) {
            console.log(img.src, "加载完成", targetLoadId);
            $("#" + targetLoadId).hide();
        })
    });
    function loadImage(url, targetLoadId, callback) {
        var img = new Image();
        img.src = url;

        if(img.complete) {
            callback(img, targetLoadId);
            return;
        }
        img.onload = function () {
            callback(img, targetLoadId);
        };
    }
</script>
<script>
    var _hmt = _hmt || [];
    (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?cbe774ebaa00e2bbd30b43935172a62f";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
</body>
</html>
